#ifndef ITEMS
#define ITEMS


#ifdef WIN32
#pragma once
#endif

#include "phatx.h"
#include "phatSS.h"


/* Todo ///////////////////////////////////////////////////////////////////////
/   add melee
/   add spells
/   add potions
/   add modifiers
/	
/	Finish and polish items, weapons and armors
/	Reorganize virtual void *::Use() to take advantage of common shared actions
/   Bugs:
/////////////////////////////////////////////////////////////////////////////*/


/*

What do all items do? They have a name, description, a value, it could have a level requirement, it could be locked, it could be heavy,
it could be two handed and and it could be sell able.
What do all weapons do? They have a damage, dice number, critical range & modifier, it could be magic, could be throwable,
could have a count, could be ranged
what do all armors do? They have a ac, a protection value, a type, could be two handed i.e a buckler, it could be magic.
*/

static enum
{
	food=0, hp, mp, magic_potion, valuable, chest=10, unique, quest
} CITEMTYPE;
static enum
{
	open=0
} CITEMACTION;

class cItem
{
protected:
	string mName;
	string mDescription;

	int mValue;
	int mLevelRequired;
	int mType;			// 0 is food, 1 is hp, 2 is mp, 3 is magic potion, 4 is gem/valuable, 10 is chest, 11 is unique, 12 is quest item
	bool isTwoHanded;
	bool isHeavy;
	bool isSellable;

	
private: // doesn't need to be inherited
	bool isConsumeable;
	bool isLocked; // for chests and the like
	int mCollection; // meat, or fruit or veggies
	int mXpWorth; // xp returns from foods
public:
	cItem();
	cItem( string name, string desc, int type, int value = 0, bool twoh = false, bool heavy = false, bool sell = true, 
	bool consumeable=false, bool locked=false ); // your standard item
	~cItem();
	virtual bool Use(string sAction); // Every item gets used

	// Accessors
	const string getName() { return mName; }
	const string getDesc() { return mDescription; }
	const int getValue() { return mValue; }
	const int getLevelReq() { return mLevelRequired; }
	const int getType() { return mType; }
	const bool getTwoHanded() { return isTwoHanded; }
	const bool getHeavy() { return isHeavy; }
	const bool getSellable() { return isSellable; }
	const bool getConsumable() { return isConsumeable; }
	
	void setName( string tmp ) { mName = tmp; }
	void setDesc( string tmp ) { mDescription = tmp; }
	void setValue( int tmp) { if( tmp > 0 ) mValue = tmp; }
	void setLevelReq( int tmp ) { if ( tmp > 1 ) mLevelRequired = tmp; }
	void setType( int tmp ) { mType = tmp; }
	void setTwoHanded( bool tmp ) { isTwoHanded = tmp; }
	void setHeavy( bool tmp ) { isHeavy = tmp; }
	void setSellable( bool tmp ) { isSellable = tmp; }
	void setConsumable( bool tmp ) { isConsumeable = tmp; }
	
	
	// Food only
	void setCollection( int tmp) { mCollection = tmp; }
	void setXpWorth( int tmp ) { mXpWorth = tmp; }

	const int getCollection() { return mCollection; }
	const int getXpWorth() { return mXpWorth; }
	// Chest only
	void setLocked( bool tmp ) { isLocked = tmp; }

	const bool getLocked() { return isLocked; }

};


#endif